package com.lone.design.pattern.creational.prototype.deep;

/**
 * @author Lone
 * @date 2021/9/24 15:04 周五
 */
public class CitationTest {
    public static void main(String[] args) throws CloneNotSupportedException {
        // 浅克隆存在问题
        Citation citation1 = new Citation();
        Student student = new Student("小明", "北京");
        citation1.setStudent(student);

        Citation citation2 = citation1.clone();

        citation2.getStudent().setName("小李");
        /*citation1.setName("小明");
        citation2.setName("小李");*/

        citation1.show();
        citation2.show();
    }
}
